<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/hpp_c1_c2.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<%@ include file="/common/meta.jsp" %>
<title>VTC - Holistic Programme Planning - HPP</title>
<%@ include file="/common/css_js.jsp"%>

<script type="text/javascript">

	$(function(){
		iframeResize(self,"programmeIframe","programmeInfoDiv");
		
		var programmeId="<s:property value='programmeId'/>";
		if(programmeId!=""){
			
			//Control duration
			$("#durationTd").show();
			$("#durationTypeTd").show();
			$("#durationSelectTd").hide();
			
			
			//Disabled these input
			$("#programmeCode").attr("disabled",true);//1
			$("#firstLaunchYear").attr("disabled",true);//2
			$("#launchVersion").attr("disabled",true);//3
			$("#isStreamOrProgramme").attr("disabled",true);//4
			$("#foundingMode").attr("disabled",true);//5
			$("#studyMode").attr("disabled",true);//6
			$("#minimumnEntryLevel").attr("disabled",true);//7
			$("#duration").attr("disabled",true);//8
			$("#durationType").attr("disabled",true);//8
			$("#subjectGroupBox").attr("disabled",true);//9
			$("#subjectGroupFeeder").attr("disabled",true);//10
			$("#requirePlanning").attr("disabled",true);//11
			$("#garType").attr("disabled",true);//12
			$("#internalValidationPeriod").attr("disabled",true);//13
			$("#cardExpiry").attr("disabled",true);//14 
			$("#approvalDate").attr("disabled",true);//15
			$("#launchYear").attr("disabled",true);//16			
			
		}
		
		
		displayMainStreamOrNot("<s:property value='programme.discipline'/>")
		
		
		$("#mainForm").validate({
			rules: {
				"programme.launchYear": {
					required: true,
					digits:true,
					max:2200,
					min:1960
				},
				"programme.code":{
					maxlength:100
				},
				"programme.launchVersion":{
					maxlength:100
				},
				"programme.titleShort":{
					maxlength:100
				},
				"programme.titleLong":{
					maxlength:1000
				},
				"programme.titleZhShort":{
					maxlength:100
				},
				"programme.titleZhLong":{
					maxlength:1000
				},
				"programme.discipline":{
					maxlength:100
				},
				"programme.fundingMode":{
					maxlength:100
				},
				"programme.studyMode":{
					maxlength:100
				},
				"programme.qfLevel":{
					maxlength:30
				}
			}
		 });	
		
		var duration="<s:property value='programme.duration'/>";
		$("#durationSelect").val(duration);
		
		var canEditCode="<s:property value='canEditCode'/>";
		if(canEditCode=="NO"){
			$("#programmeCode").attr("readonly",true);//1
		}
		
		var feederOrReceiver="<s:property value='feederOrReceiver'/>";
		if(feederOrReceiver=="true"){
			$("#requireStream").attr("disabled",true);//1
			$("#addStreamBtn").attr("disabled",true);//1
		}
		
		//Check code by procedure in DB
		var checkCode=function(){
			
			var programmeCode=$("#programmeCode").val();
			var launchYear=$("#launchYear").val();
			var launchVersion=$("#launchVersion").val();
			

			if(programmeCode==""||launchYear==""||launchVersion==""){
				return;
			}
			
			$.ajax({
				url : "programme-info!checkCode.action?code="+programmeCode+"&launchYear="+launchYear+"&launchVersion="+launchVersion,
				cache : true,
				dataType : "json",
				async : false,
				success : function(map) {
					if(map.message=="YES"){
						$("#discipline").val(map.discipline);
						$("#discipline_label").val(map.discipline_label);
						displayMainStreamOrNot(map.discipline)
						
						$("#fundingMode").val(map.fundingMode);
						$("#fundingMode_label").val(map.fundingMode_label);
						
						$("#studyMode").val(map.studyMode);
						$("#studyMode_label").val(map.studyMode_label);
						
						$("#qfLevel").val(map.qfLevel);
						$("#qfLevel_label").val(map.qfLevel_label);
						
						$("#programmeCodeMsg").html("Code is valid, and the Discipline, Funding Mode, Study Mode,and QF Level have been retried!");
						
					}else{
						$("#discipline").val("");
						$("#discipline_label").val("");
						displayMainStreamOrNot("")
						
						$("#fundingMode").val("");
						$("#fundingMode_label").val("");
						
						$("#studyMode").val("");
						$("#studyMode_label").val("");
						
						$("#qfLevel").val("");
						$("#qfLevel_label").val("");
						
						$("#programmeCodeMsg").html(map.message);
					}
				},
				error : function(data) {
					$("#errorMsgSpan").html(data);
				}
			});	
		}
		
		$("#programmeCode").blur(checkCode);
		$("#launchYear").blur(checkCode);
		$("#launchVersion").blur(checkCode);
		
	});
	
	
	function displayMainStreamOrNot(discipline){
		if(discipline=="Pro-Act Centre"||discipline=="HITDC"||discipline=="CCTI"||discipline=="MSTI"){
			$("#mainStreamTd").show();
			$("#proActTd").show();
			
			$("#mainStream").attr("disabled",false);
			$("#programmeType").attr("disabled",false);
			
		}else{
			$("#mainStreamTd").hide();
			$("#proActTd").hide();
			
			$("#mainStream").attr("disabled",true);
			$("#programmeType").attr("disabled",true);
		}
	}
	
	function clickBtn(action,e,id){
		var programmeId="<s:property value='programmeId'/>";
		
		switch(action){
		case "save":
			$("#mainForm").attr("action","programme-info!save.action");
			$("#mainForm").submit();
			return;
			
		case "confirm":
			$("#mainForm").attr("action","programme-info!confirm.action");
			$("#mainForm").submit();
			return;
			
		case "cancel":
			window.location="programme.action";
			return;
			
		case "delete":
			$("#mainForm").attr("action","programme-info!delete.action");
			$("#mainForm").submit();
			return;
			
		case "addStream":
			parent.popup(e, "stream!input.action?no-decorate&programmeId="+programmeId, "width:950;height:550");
			return;
			
		case "editStream":
			parent.popup(e, "stream!input.action?no-decorate&programmeId="+programmeId+"&stream.id="+id, "width:950;height:550");
			return;
			
		case "deleteStream":
			$("#streamForm").attr("action","programme-info!deleteStream.action?streamId="+id);
			$("#streamForm").submit();
			return;					
		}
		
	}	
	
	function durationSelectChange(durationOption){
		if(durationOption!="Other"){
			$("#durationTd").hide();
			$("#durationTypeTd").hide();
			
			$("#duration").val(durationOption);
			$("#durationType").val("Year");
			
		}else{
			$("#durationTd").show();
			$("#durationTypeTd").show();
		}
		
	}	
</script> 

</head>

<body>	
	
   <div class="pageTitle">Programme Maintenance - <s:if test="programme.id!=null&&programme.id!=''">Edit</s:if>
   <s:else>Create</s:else> </div>
   <div class="wTab">
     <table height="100%" cellspacing="0" cellpadding="0" border="0" id="programmeTabs">
       <tbody><tr>
         <td id="itemA" class="item2">
         	<a href="programme-info.action?programmeId=<s:property value='programmeId'/>">Programme Information</a>
         </td>
         <s:if test="programmeId!=null&&programmeId!=''">
	         <td id="itemB" class="item1">
	         	<a href="programme-accreditation.action?programmeId=<s:property value='programmeId'/>">Programme Accreditation</a>
	         </td>
	         <td id="itemC" class="item1">
	         	<a href="programme-subject-group.action?programmeId=<s:property value='programmeId'/>">Subject Group</a>
	         </td>
         </s:if>
         
       </tr>
      </tbody>
     </table>
   </div>

	<div class="form2" id="programmeInfoDiv">
	  <span class="label" id="errorMsgSpan"></span>
	  <s:actionerror/>
	  <s:fielderror/>
	  <s:actionmessage/> 
			  
	  <s:form id="mainForm" name="mainForm" namespace="/programme" 
	  		  action="programme-info.action" validate="true">
	  	<s:hidden name="programmeId"></s:hidden>
		<s:hidden name="programme.id"></s:hidden>
		
		<s:hidden name="copyFromId"></s:hidden>
		<s:hidden name="canEditCode"></s:hidden>
	
       	<div class="pageTitle2">Section 1</div>
         
        <table cellspacing="0" cellpadding="0" border="0">
           <tbody><tr>
             <td class="sep"><img style="width:180px;" src="../images/spacer.gif"></td>
          	 <td class="sep"><img style="width:180px;" src="../images/spacer.gif"></td>
          	 <td class="sep"><img style="width:180px;" src="../images/spacer.gif"></td>
             <td class="sep sep2"><img src="../images/spacer.gif"></td>
        </tr>
        <tr>
          <td><label class="fLabel">Programme Code</label>
            <div class="fField">
              <s:textfield id="programmeCode" name="programme.code" cssStyle="width:150px" cssClass="required"/>
            </div></td>
          <td colspan="3" valign="bottom"><span class="errorLabel" id="programmeCodeMsg"></span></td>   
        </tr>
        <tr>
          <td><label class="fLabel">Launch Year </label>
            <div class="fField">
              <s:textfield name="programme.launchYear" id="launchYear" cssStyle="width:150px" />
            </div></td>
          <td><label class="fLabel">Launch Version </label>
            <div class="fField">
              <s:textfield name="programme.launchVersion" id="launchVersion" cssClass="required" cssStyle="width:150px" />
            </div></td>
        </tr>
        
        <tr>
          <td id="durationSelectTd"><label class="fLabel">Duration</label>
            <div class="fField">
              <select style="width:155px" name="durationSelect" id="durationSelect" class="inputSelect required" onchange="durationSelectChange(this.value)">
                <option value="">-All-</option>
                <option value="1">1 Year</option>
                <option value="2">2 Year</option>
                <option value="3">3 Year</option>
                <option value="4">4 Year</option>
                <option value="Other">Other</option>
              </select>
            </div>
          </td>
          <td id="durationTd" style="display:none;">
          	<label class="fLabel">Duration</label>
            <div class="fField">
              <s:textfield name="programme.duration" id="duration" cssClass="required" cssStyle="width:150px" />
            </div>
          </td>
          <td id="durationTypeTd" style="display:none;">
          	<label class="fLabel">Duration Type </label>
            <div class="fField">
            
	            <s:select cssClass="required" cssStyle="width:155px" name="programme.durationType" 
	            		  id="durationType"
	            		  list="@com.lightsaber.trade.cloth.entity.programme.DurationType@list()" listKey="key" listValue="value">
	            </s:select>
            </div>
            
            </td>
        </tr>
        <tr>
          <td><label class="fLabel">Programme Approval Date </label>
            <div class="fField">
               <s:textfield cssStyle="width:155px" name="programme.approvalDate" id="approvalDate" disabled="true"></s:textfield>
            </div>
          </td>
          
          <td><label class="fLabel">Programme Status </label>
            <div class="fField">
              <input type="text" disabled="disabled" style="width:150px" name="programme.status"  value="<s:property value='programme.status'/>">
            </div>
          </td>
          
          <s:if test="canEditCode=='NO'">
	            <td><label class="fLabel">Revision Type </label>
		            <div class="fField">
			            <s:select cssStyle="width:155px" name="programme.revisionType" id="revisionType"
			            		  list="paramService.revisionTypeList" listKey="code" listValue="desc"
			            		  headerKey="" headerValue="-- Select --">
			            </s:select>  
		            </div>
	            </td>
           </s:if> 
           <s:if test="programmeId!=null&&programmeId!=''">
	            <td><label class="fLabel">Revision Type </label>
		            <div class="fField">
			            <s:select cssStyle="width:155px" name="programme.revisionType" id="revisionType"
			            		  list="paramService.revisionTypeList" listKey="code" listValue="desc"
			            		  headerKey="" headerValue="-- Select --">
			            </s:select>  
		            </div>
	            </td>
            </s:if>            
           
        </tr>
      </tbody></table>
      <br>
      <div class="pageTitle2">Section 2</div>
      <table cellspacing="0" cellpadding="0" border="0">
        <tbody><tr>
          <td class="sep"><img style="width:180px;" src="../images/spacer.gif"></td>
          <td class="sep"><img style="width:180px;" src="../images/spacer.gif"></td>
          <td class="sep"><img style="width:180px;" src="../images/spacer.gif"></td>
          <td class="sep sep2"><img src="../images/spacer.gif"></td>
        </tr>
        <tr>
          <td colspan="2"><label class="fLabel">Programme Title (Short) </label>
            <div class="fField">
              <s:textfield id="programme.titleShort" name="programme.titleShort" cssStyle="width:330px" cssClass="inputText"/>
            </div></td>
          <td colspan="2"><label class="fLabel">Programme Title (Long)</label>
            <div class="fField">
              <s:textfield id="programme.titleLong" name="programme.titleLong" cssStyle="width:330px" cssClass="inputText"/>
            </div></td>
          <td></td>
        </tr>
        <tr>
          <td colspan="2"><label class="fLabel">Programme Title in Chinese (Short)</label>
            <div class="fField">
              <s:textfield id="programme.titleZhShort" name="programme.titleZhShort" cssStyle="width:330px" cssClass="inputText"/>
            </div></td>
          <td colspan="2"><label class="fLabel">Programme Title in Chinese (Long)</label>
            <div class="fField">
              <s:textfield id="programme.titleZhLong" name="programme.titleZhLong" cssStyle="width:330px" cssClass="inputText"/>
            </div></td>
          <td></td>
        </tr>
      </tbody></table>
      <br>
      <div class="pageTitle2">Section 3</div>
      <table cellspacing="0" cellpadding="0" border="0">
        <tbody><tr>
          <td class="sep"><img style="width:180px;" src="../images/spacer.gif"></td>
          <td class="sep"><img style="width:180px;" src="../images/spacer.gif"></td>
          <td class="sep"><img style="width:180px;" src="../images/spacer.gif"></td>
          <td class="sep sep2"><img src="../images/spacer.gif"></td>
        </tr>
        <tr>
          <td><label class="fLabel">Programme Category </label>
            <div class="fField">
	            <s:select cssClass="required" cssStyle="width:155px" name="programme.preEmploymentInService" 
	            		  list="paramService.preEmploymentInServiceList" listKey="code" listValue="desc"
	            		  headerKey="" headerValue="-- Select --">
	            </s:select>
            </div></td>
        </tr>
        <tr>
          <td><label class="fLabel">Discipline / Faculty / OU</label>
            <div class="fField">
            	<s:hidden id="discipline" name="programme.discipline"></s:hidden>
            	<input type="text" id="discipline_label" value="<s:property value='discipline_label'/>" 
            	       class="inputText required" readonly="readonly" style="width:155px"/>
	     <%--   <s:select cssClass="required" cssStyle="width:155px" 
	            		  id="disciplineTemp" disabled="true"
	            		  list="paramService.disciplineList" listKey="code" listValue="desc"
	            		  headerKey="" headerValue="-- Select --">
	            </s:select> --%>
            </div>
          </td>
            
          <td id ="mainStreamTd" style="display:none;"><label class="fLabel">Main Stream </label>
            <div class="fField">
	            <s:select cssClass="required" cssStyle="width:155px" name="programme.mainStream" id="mainStream"
	            		  list="paramService.mainStreamList" listKey="code" listValue="desc" disabled="true"
	            		  headerKey="" headerValue="-- Select --">
	            </s:select>
            </div>
          </td>
          
          <td colspan="2"  id ="proActTd" style="display:none;">
          	<label class="fLabel">Pro-Act Centre Programme Type </label>
            <div class="fField">
	            <s:select cssClass="required" cssStyle="width:155px" name="programme.programmeType" id="programmeType"
	            		  list="paramService.programmeTypeList" listKey="code" listValue="desc" disabled="true"
	            		  headerKey="" headerValue="-- Select --">
	            </s:select>   
            </div>
           </td>
        </tr>
        <tr>
          <td colspan="2"><label class="fLabel">Programme Board / Academic Owner</label>
            <div class="fField">
	            <s:select cssClass="inputSelect" cssStyle="width:150px" name="programme.board" 
	            		  list="paramService.programmeBoardList" listKey="code" listValue="desc"
	            		  headerKey="" headerValue="-- Select --">
	            </s:select>
            </div></td>
        </tr>
        <tr>
          <td><label class="fLabel"> Funding Mode </label>
            <div class="fField">
            	<s:hidden id="fundingMode" name="programme.fundingMode"></s:hidden>
            	<input type="text" id="fundingMode_label" value="<s:property value='fundingMode_label'/>" 
            	       class="inputText required"  readonly="readonly" style="width:155px"/>
<%-- 	            <s:select cssClass="required" cssStyle="width:155px"
	            		  id="foundingModeTemp"  disabled="true"
	            		  list="paramService.fundingModeList" listKey="code" listValue="desc"
	            		  headerKey="" headerValue="-- Select --">
	            </s:select>  --%>
            </div></td>
          <td colspan="2"><label class="fLabel">Delivery Mode / Study Mode</label>
            <div class="fField">
            	<s:hidden id="studyMode" name="programme.studyMode"></s:hidden>
            	<input type="text" id="studyMode_label" value="<s:property value='studyMode_label'/>" 
            	       class="inputText required" readonly="readonly" style="width:150px"/>            	 
<%-- 	            <s:select cssClass="required" cssStyle="width:150px" 
	            	      id="studyModeTemp"  disabled="true"
	            		  list="paramService.studyModeList" listKey="code" listValue="desc"
	            		  headerKey="" headerValue="-- Select --">
	            </s:select> --%>
            </div>
         </td>
        </tr>
        <tr>
          <td><label class="fLabel">QF Level</label>
            <div class="fField">
            	<s:hidden id="qfLevel" name="programme.qfLevel"></s:hidden>
            	<input type="text" id="qfLevel_label" value="<s:property value='qfLevel_label'/>" 
            	       class="inputText required" readonly="readonly" style="width:155px"/>  
            	                   	
	   <%--          <s:select cssClass="required" cssStyle="width:155px" id="qfLevelTemp" disabled="true"
	            		  list="paramService.qFLevelList" listKey="code" listValue="desc"
	            		  headerKey="" headerValue="-- Select --">
	            </s:select>    --%>
            </div>
           </td>
          <td><label class="fLabel">Level of Study </label>
            <div class="fField">
	            <s:select cssClass="required" name="programme.studylevel" cssStyle="width:150px" 
	            		  list="paramService.levelOfStudyList" listKey="code" listValue="desc"
	            		  headerKey="" headerValue="-- Select --">
	            </s:select> 
            </div></td>
        </tr>
        <tr>
          <td><label class="fLabel"> Highest Award </label>
            <div class="fField">
	            <s:select cssClass="required" cssStyle="width:155px" name="programme.award" 
	            	      id="highestAward"
	            		  list="paramService.awardList" listKey="code" listValue="desc"
	            		  headerKey="" headerValue="-- Select --">
	            </s:select>
            </div>
          </td>
          
          <td>
          	<label class="fLabel">Minimumn Entry Level</label>
            <div class="fField">
	            <s:select cssClass="required" cssStyle="width:155px" name="programme.minimumnEntryLevel" 
	                      id="minimumnEntryLevel"
	            		  list="paramService.minimumnEntryLevelList" listKey="code" listValue="desc"
	            		  headerKey="" headerValue="-- Select --">
	            </s:select>
            </div>
          </td>
          
          <td>
          	<label class="fLabel">GAR Type</label>
            <div class="fField">
	            <s:select cssClass="required" cssStyle="width:155px" name="programme.garType" 
	                      id="garType"
	            		  list="paramService.garTypeList" listKey="code" listValue="desc"
	            		  headerKey="" headerValue="-- Select --">
	            </s:select> 
            </div></td>
        </tr>
        
        <tr>
          <td>
          	<label class="fLabel">Require Planning at Stream Level</label>
            <div class="fField">
	            <input type="checkbox" class="inputCheckbox" id="requireStream" name="programme.requireStream" value="true"
	                   <s:if test='programme.requireStream'>checked</s:if>/> 
            </div>
           </td>        
         </tr>
      </tbody></table>
      <br>
      <div class="btnSet btnSetTypeA">
        <div class="left"> 
        	
        	<s:if test="canEdit">
		          <div class="button">
		            <div class="left">
		              <div class="right">
		                	<input type="button" onclick="clickBtn('save')" value="Save" name="" id="" class="inputButton"></input>	
		              </div>
		            </div>
		          </div>
		    </s:if>      
           
          <div class="button">
            <div class="left">
              <div class="right">
                <input type="button" onclick="clickBtn('cancel')" value="Cancel" name="" id="" class="inputButton">
              </div>
            </div>
          </div> 
           
          <s:if test="programme.id!=null&&programme.id!=''">
          
	            <s:if test="canEdit">
		          <div class="button">
		            <div class="left"> 
		              <div class="right">
		            	
		               	 <input type="button" onclick="clickBtn('confirm')" value="Confirm" name="" id="" class="inputButton">
		                
		              </div>
		            </div>
		          </div>
	         
	          
		          <div class="button">
		            <div class="left">
		              <div class="right">
		                <input type="button" onclick="clickBtn('delete')" value="Delete" name="" id="" class="inputButton">
		              </div>
		            </div>
		          </div>
	          
	           </s:if>
           
          </s:if>
        </div>
      </div>
      
      
   </s:form>
   </div>  	
   
   <s:if test="programmeId!=null&&programmeId!=''">
		<div class="wTab">
         <table cellspacing="0" cellpadding="0" border="0" id="wMu">
            <tbody>
	           <tr>
	             <td id="itemA" class="item2">
	             	<a href="programme-plan-projection-type.action?no-decorate&programmeId=<s:property value='programmeId'/>" 
	                 target="programmeIframe" onclick="selectTab('wMu', 'itemA');">Programme Plan Projection Type</a></td>
	             <td id="itemB" class="item1">
	             	<a href="offering-campus.action?no-decorate&programmeId=<s:property value='programmeId'/>" target="programmeIframe"
	                 onclick="selectTab('wMu', 'itemB');">Offering Campus</a></td>
	             <td id="itemC" class="item1">
				   <a href="curriculum-hour.action?no-decorate&programmeId=<s:property value='programmeId'/>" target="programmeIframe"
	                 onclick="selectTab('wMu', 'itemC');">Curriculum Hours</a></td>
	             <td id="itemD" class="item1">
	               <a href="programme-leader.action?no-decorate&programmeId=<s:property value='programmeId'/>" target="programmeIframe"
	                 onclick="selectTab('wMu', 'itemD');">Programme Leader</a></td>	                 	                 
	           </tr>
         	</tbody>
         </table>
       </div>  
       
	 
	   <iframe id="programmeIframe" name="programmeIframe" src="programme-plan-projection-type.action?no-decorate&programmeId=<s:property value='programme.id'/>" 
	   		   style="width:100%;height: 150px;" frameborder="0" scrolling="no"></iframe>
       
       
       <!-- Stream Edit form -->
	 
	 <s:form id="streamForm" name="streamForm" namespace="/programme" action="programme-info.action" validate="true">
		<s:hidden name="programmeId"></s:hidden>
		
	  <div class="pageTitle2">Programme Stream</div>
	   <div class="sListBorder">
	          <div class="sList">
	            <table cellspacing="0" cellpadding="0" border="0" width="100%" class="sTable">
	              <tbody><tr>
	                <td class="sTh">Stream Code </td>
	                <td class="sTh">Stream Title (Short)</td>
	                <td class="sTh">Action</td>
	              </tr>
	              
			      <s:iterator value="streams" var="stream" status="st">
			       
			      	  <s:set var="trClass" value="'sRow1'"></s:set>
			    	  <s:if test="#st.index%2==0">
			       	 	 <s:set var="trClass" value="'sRow2'"></s:set>
					  </s:if>
				      <s:else>
			       	     <s:set var="trClass" value="'sRow1'"></s:set>
			       	  </s:else>
					  
				      <tr class="<s:property value='#trClass'/>">
				                    
		                <td class="sCell"><s:property value="#stream.code"/>-<s:property value="#stream.streamCode"/></td>
		                <td class="sCell"><s:property value="#stream.titleShort"/></td>
		                <td class="sCell buttonCell">
		                
		                <div class="button sbtn">
		                   <div class="button">
			                    <div class="left">
			                      <div class="right">
			                        <input type="button" onclick="clickBtn('editStream',event,'<s:property value='#stream.id'/>')" value="Edit" name="" id="" class="inputButton">
			                      </div>
			                    </div>
		                    </div>
		                    <s:if test="canEdit">
			                    <div class="button">
					                <div class="left">
					                  <div class="right">
					                    <input type="button" onclick="clickBtn('deleteStream',event,'<s:property value='#stream.id'/>')" value="Delete"  name="" id="" class="inputButton">
					                  </div>
					                </div>	
				                </div>
			                </s:if>
			      
		                  </div>
		                 </td>
		                 
		              </tr>
	              </s:iterator>
	              
	             </tbody>
	            </table>
	          </div>
	          
	          <div class="btnSet btnSetTypeA">
	            <div class="left">
	            <s:if test="canEdit">
              		 <div class="button">
		               <div class="left">
		                  <div class="right">
		                    <input type="button" onclick="clickBtn('addStream',event)" value="Add" name="" id="addStreamBtn" class="inputButton"/>
		                  </div>
		                </div>
		              </div>
                </s:if>
	            </div>
	         </div>
      </div>
	 </s:form>
	 </s:if>	   
</body>
</html>   